import { createRouter, createWebHashHistory } from 'vue-router'

const router = createRouter({
    history: createWebHashHistory(),
    // 映射关系：path -> component
    routes: [
        {
            path: '/',
            redirect: '/home'
        },
        {
            path: '/home',
            component: () => import("@/views/Home/home.vue")
        },
        {
            path: '/order',
            component: () => import("@/views/Order/order.vue")
        },
        {
            path: '/message',
            component: () => import("@/views/Message/message.vue")
        },
        {
            path: '/favorite',
            component: () => import("@/views/Favorite/favorite.vue")
        },
        {
            path: '/city',
            component: () => import("@/views/City/city.vue"),
            // 是否隐藏tabbar组件
            meta: {
                isHideTabbar: true
            }
        },
        {
            path: '/search',
            component: () => import("@/views/Search/search.vue"),
            meta: {
                isHideTabbar: true
            }
        }
    ]
})

export default router